Skip to main content

Work commuting

The example below shows how to create statistics on job commuting using information on municipality of residence and municipality of workplace. People who work in a municipality other than the municipality of residence are defined as job commuters. It is important that the same measurement time is used for the two variables.

 require no.ssb.fdb:31 as db

create-dataset commuting
import db/BOSATTEFDT_BOSTED 2022-11-16 as residence
import db/REGSYS_ARB_ARBKOMM 2022-11-16 as workplace
drop if sysmiss(workplace)

generate commuter = residence != workplace 

textblock
The proportion of job commuters (people who work in a different municipality than residence) as of 16/11 2022:
endblock
tabulate commuter, cellpct freq

generate residence_county = substr(residence,1,2)
generate work_county = substr(workplace,1,2)

define-labels county_label '03' Oslo '11' Rogaland '15' 'Møre og Romsdal' '18' Nordland '30' Viken '34' Innlandet '38' 'Vestfold og Telemark' '42' Agder '46' Vestland '50' Trøndelag '54' 'Troms og Finnmark'

assign-labels residence_county county_label
assign-labels work_county county_label

textblock
Job commuters distributed by residence county and work county:
endblock
tabulate residence_county work_county if commuter
tabulate residence_county work_county if commuter, rowpct